#include <bits/stdc++.h>

using namespace std;
using ll = long long;
const ll MOD = 998244353;

ll qpow(ll base, ll exp) {
	ll res = 1;
	base %= MOD;
	while (exp > 0) {
		if (exp % 2 == 1) res = (res * base) % MOD;
		base = (base * base) % MOD;
		exp /= 2;
	}
	return res;
}

void solve() {
	ll n, k;
	cin >> n >> k;
	vector<ll> a(n + 1);
	for (ll i = 1; i <= n; i++) cin >> a[i];
	ll rig = 0;
	ll rigmx = LLONG_MAX;
	for (ll i = 1; i < n; i++) {
		if (i % 2 == 1) {
			rig += a[i];
		} else {
			rig -= a[i];
		}
		rigmx = min(rigmx, rig);
	}
	ll r = -rigmx;
	if (r >= 62) {
		k = 0;
	} else {
		k >>= rigmx;
	}
	ll left = rig - rigmx;
	ll ans = (k % MOD) * qpow(2, left) % MOD;
	cout << ans << endl;
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int t; cin >> t; while (t-- > 0) solve();
	return 0;
}